home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / tags18.zip / SORT.INF < prev    next >
Text File  |  1990-08-26  |  22KB  |  550 lines

  1. Info file sort.info, produced by Makeinfo, -*- Text -*- from input
  2. file sort.tex.
  3.  
  4. This file documents the MS-DOS port of the GNU sort utility.
  5.  
  6. Copyright (C) 1990 Thorsten Ohl, <td12@ddagsi3.bitnet> $Header:
  7. e:/gnu/sort/RCS/sort.t'v 0.1 90/08/26 19:00:07 tho Exp $
  8.  
  9. Permission is granted to make and distribute verbatim copies of this
  10. manual provided the copyright notice and this permission notice are
  11. preserved on all copies.
  12.  
  13. Permission is granted to copy and distribute modified versions of
  14. this manual under the conditions for verbatim copying, provided also
  15. that the section entitled ``GNU General Public License'' is included
  16. exactly as in the original, and provided that the entire resulting
  17. derived work is distributed under the terms of a permission notice
  18. identical to this one.
  19.  
  20. Permission is granted to copy and distribute translations of this
  21. manual into another language, under the above conditions for modified
  22. versions, except that the text of the translations of the section
  23. entitled ``GNU General Public License'' must be approved for accuracy
  24. by the Foundation.
  25.  
  26.  
  27. 
  28. File: sort.info,  Node: Top,  Up: (Dir)
  29.  
  30. * Menu:
  31.  
  32. * Copying::        Legal matters.
  33. * Introduction::    Generalilties.
  34. * Installation::    How to make GNU `sort'.
  35. * Options::        How to tell `sort' how to sort ...
  36. * MS-DOS::        How the MS-DOS version differs.
  37.  
  38.  
  39. 
  40. File: sort.info,  Node: Copying,  Next: Introduction,  Up: Top
  41.  
  42. GNU GENERAL PUBLIC LICENSE
  43. **************************
  44.  
  45.                         Version 1, February 1989
  46.  
  47.      Copyright (C) 1989 Free Software Foundation, Inc.
  48.      675 Mass Ave, Cambridge, MA 02139, USA
  49.      
  50.      Everyone is permitted to copy and distribute verbatim copies
  51.      of this license document, but changing it is not allowed.
  52.  
  53.  Preamble
  54. =========
  55.  
  56.   The license agreements of most software companies try to keep users
  57. at the mercy of those companies.  By contrast, our General Public
  58. License is intended to guarantee your freedom to share and change
  59. free software--to make sure the software is free for all its users. 
  60. The General Public License applies to the Free Software Foundation's
  61. software and to any other program whose authors commit to using it. 
  62. You can use it for your programs, too.
  63.  
  64.   When we speak of free software, we are referring to freedom, not
  65. price.  Specifically, the General Public License is designed to make
  66. sure that you have the freedom to give away or sell copies of free
  67. software, that you receive source code or can get it if you want it,
  68. that you can change the software or use pieces of it in new free
  69. programs; and that you know you can do these things.
  70.  
  71.   To protect your rights, we need to make restrictions that forbid
  72. anyone to deny you these rights or to ask you to surrender the rights.
  73. These restrictions translate to certain responsibilities for you if
  74. you distribute copies of the software, or if you modify it.
  75.  
  76.   For example, if you distribute copies of a such a program, whether
  77. gratis or for a fee, you must give the recipients all the rights that
  78. you have.  You must make sure that they, too, receive or can get the
  79. source code.  And you must tell them their rights.
  80.  
  81.   We protect your rights with two steps: (1) copyright the software,
  82. and (2) offer you this license which gives you legal permission to
  83. copy, distribute and/or modify the software.
  84.  
  85.   Also, for each author's protection and ours, we want to make certain
  86. that everyone understands that there is no warranty for this free
  87. software.  If the software is modified by someone else and passed on,
  88. we want its recipients to know that what they have is not the
  89. original, so that any problems introduced by others will not reflect
  90. on the original authors' reputations.
  91.  
  92.   The precise terms and conditions for copying, distribution and
  93. modification follow.
  94.  
  95.                           TERMS AND CONDITIONS
  96.  
  97.   1. This License Agreement applies to any program or other work
  98.      which contains a notice placed by the copyright holder saying it
  99.      may be distributed under the terms of this General Public
  100.      License.  The ``Program'', below, refers to any such program or
  101.      work, and a ``work based on the Program'' means either the
  102.      Program or any work containing the Program or a portion of it,
  103.      either verbatim or with modifications.  Each licensee is
  104.      addressed as ``you''.
  105.  
  106.   2. You may copy and distribute verbatim copies of the Program's
  107.      source code as you receive it, in any medium, provided that you
  108.      conspicuously and appropriately publish on each copy an
  109.      appropriate copyright notice and disclaimer of warranty; keep
  110.      intact all the notices that refer to this General Public License
  111.      and to the absence of any warranty; and give any other
  112.      recipients of the Program a copy of this General Public License
  113.      along with the Program.  You may charge a fee for the physical
  114.      act of transferring a copy.
  115.  
  116.   3. You may modify your copy or copies of the Program or any portion
  117.      of it, and copy and distribute such modifications under the
  118.      terms of Paragraph 1 above, provided that you also do the
  119.      following:
  120.  
  121.         * cause the modified files to carry prominent notices stating
  122.           that you changed the files and the date of any change; and
  123.  
  124.         * cause the whole of any work that you distribute or publish,
  125.           that in whole or in part contains the Program or any part
  126.           thereof, either with or without modifications, to be
  127.           licensed at no charge to all third parties under the terms
  128.           of this General Public License (except that you may choose
  129.           to grant warranty protection to some or all third parties,
  130.           at your option).
  131.  
  132.         * If the modified program normally reads commands
  133.           interactively when run, you must cause it, when started
  134.           running for such interactive use in the simplest and most
  135.           usual way, to print or display an announcement including an
  136.           appropriate copyright notice and a notice that there is no
  137.           warranty (or else, saying that you provide a warranty) and
  138.           that users may redistribute the program under these
  139.           conditions, and telling the user how to view a copy of this
  140.           General Public License.
  141.  
  142.         * You may charge a fee for the physical act of transferring a
  143.           copy, and you may at your option offer warranty protection
  144.           in exchange for a fee.
  145.  
  146.      Mere aggregation of another independent work with the Program
  147.      (or its derivative) on a volume of a storage or distribution
  148.      medium does not bring the other work under the scope of these
  149.      terms.
  150.  
  151.   4. You may copy and distribute the Program (or a portion or
  152.      derivative of it, under Paragraph 2) in object code or
  153.      executable form under the terms of Paragraphs 1 and 2 above
  154.      provided that you also do one of the following:
  155.  
  156.         * accompany it with the complete corresponding
  157.           machine-readable source code, which must be distributed
  158.           under the terms of Paragraphs 1 and 2 above; or,
  159.  
  160.         * accompany it with a written offer, valid for at least three
  161.           years, to give any third party free (except for a nominal
  162.           charge for the cost of distribution) a complete
  163.           machine-readable copy of the corresponding source code, to
  164.           be distributed under the terms of Paragraphs 1 and 2 above;
  165.           or,
  166.  
  167.         * accompany it with the information you received as to where
  168.           the corresponding source code may be obtained.  (This
  169.           alternative is allowed only for noncommercial distribution
  170.           and only if you received the program in object code or
  171.           executable form alone.)
  172.  
  173.      Source code for a work means the preferred form of the work for
  174.      making modifications to it.  For an executable file, complete
  175.      source code means all the source code for all modules it
  176.      contains; but, as a special exception, it need not include
  177.      source code for modules which are standard libraries that
  178.      accompany the operating system on which the executable file
  179.      runs, or for standard header files or definitions files that
  180.      accompany that operating system.
  181.  
  182.   5. You may not copy, modify, sublicense, distribute or transfer the
  183.      Program except as expressly provided under this General Public
  184.      License.  Any attempt otherwise to copy, modify, sublicense,
  185.      distribute or transfer the Program is void, and will
  186.      automatically terminate your rights to use the Program under
  187.      this License.  However, parties who have received copies, or
  188.      rights to use copies, from you under this General Public License
  189.      will not have their licenses terminated so long as such parties
  190.      remain in full compliance.
  191.  
  192.   6. By copying, distributing or modifying the Program (or any work
  193.      based on the Program) you indicate your acceptance of this
  194.      license to do so, and all its terms and conditions.
  195.  
  196.   7. Each time you redistribute the Program (or any work based on the
  197.      Program), the recipient automatically receives a license from
  198.      the original licensor to copy, distribute or modify the Program
  199.      subject to these terms and conditions.  You may not impose any
  200.      further restrictions on the recipients' exercise of the rights
  201.      granted herein.
  202.  
  203.   8. The Free Software Foundation may publish revised and/or new
  204.      versions of the General Public License from time to time.  Such
  205.      new versions will be similar in spirit to the present version,
  206.      but may differ in detail to address new problems or concerns.
  207.  
  208.      Each version is given a distinguishing version number.  If the
  209.      Program specifies a version number of the license which applies
  210.      to it and ``any later version'', you have the option of
  211.      following the terms and conditions either of that version or of
  212.      any later version published by the Free Software Foundation.  If
  213.      the Program does not specify a version number of the license,
  214.      you may choose any version ever published by the Free Software
  215.      Foundation.
  216.  
  217.   9. If you wish to incorporate parts of the Program into other free
  218.      programs whose distribution conditions are different, write to
  219.      the author to ask for permission.  For software which is
  220.      copyrighted by the Free Software Foundation, write to the Free
  221.      Software Foundation; we sometimes make exceptions for this.  Our
  222.      decision will be guided by the two goals of preserving the free
  223.      status of all derivatives of our free software and of promoting
  224.      the sharing and reuse of software generally.
  225.  
  226.                                    NO WARRANTY
  227.  
  228.  10. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
  229.      WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
  230.      LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
  231.      HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ``AS IS''
  232.      WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
  233.      INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  234.      MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE
  235.      ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS
  236.      WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE
  237.      COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
  238.  
  239.  11. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
  240.      WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
  241.      MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
  242.      LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
  243.      INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
  244.      INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS
  245.      OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
  246.      YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH
  247.      ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
  248.      ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  249.  
  250.                       END OF TERMS AND CONDITIONS
  251.  
  252. Appendix: How to Apply These Terms to Your New Programs
  253. =======================================================
  254.  
  255.   If you develop a new program, and you want it to be of the greatest
  256. possible use to humanity, the best way to achieve this is to make it
  257. free software which everyone can redistribute and change under these
  258. terms.
  259.  
  260.   To do so, attach the following notices to the program.  It is safest
  261. to attach them to the start of each source file to most effectively
  262. convey the exclusion of warranty; and each file should have at least
  263. the ``copyright'' line and a pointer to where the full notice is found.
  264.  
  265.      one line to give the program's name and a brief idea of what it does.
  266.      Copyright (C) 19yy  name of author
  267.      
  268.      This program is free software; you can redistribute it and/or modify
  269.      it under the terms of the GNU General Public License as published by
  270.      the Free Software Foundation; either version 1, or (at your option)
  271.      any later version.
  272.      
  273.      This program is distributed in the hope that it will be useful,
  274.      but WITHOUT ANY WARRANTY; without even the implied warranty of
  275.      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  276.      GNU General Public License for more details.
  277.      
  278.      You should have received a copy of the GNU General Public License
  279.      along with this program; if not, write to the Free Software
  280.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  281.  
  282.  Also add information on how to contact you by electronic and paper
  283. mail.
  284.  
  285. If the program is interactive, make it output a short notice like
  286. this when it starts in an interactive mode:
  287.  
  288.      Gnomovision version 69, Copyright (C) 19yy name of author
  289.      Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  290.      This is free software, and you are welcome to redistribute it
  291.      under certain conditions; type `show c' for details.
  292.  
  293.  The hypothetical commands `show w' and `show c' should show the
  294. appropriate parts of the General Public License.  Of course, the
  295. commands you use may be called something other than `show w' and
  296. `show c'; they could even be mouse-clicks or menu items--whatever
  297. suits your program.
  298.  
  299. You should also get your employer (if you work as a programmer) or
  300. your school, if any, to sign a ``copyright disclaimer'' for the
  301. program, if necessary.  Here a sample; alter the names:
  302.  
  303.      Yoyodyne, Inc., hereby disclaims all copyright interest in the
  304.      program `Gnomovision' (a program to direct compilers to make passes
  305.      at assemblers) written by James Hacker.
  306.      
  307.      signature of Ty Coon, 1 April 1989
  308.      Ty Coon, President of Vice
  309.  
  310. That's all there is to it!
  311.  
  312.  
  313. 
  314. File: sort.info,  Node: Introduction,  Next: Installation,  Prev: Copying,  Up: Top
  315.  
  316. General introduction to GNU `sort'.
  317. ***********************************
  318.  
  319. This is an MS-DOS port of the (unreleased) external sort program for
  320. the GNU project, written by Mike Haertel.
  321.  
  322.    * *PLEASE NOTE*:  Mike Haertel (the original author) allowed me to
  323.      distribute this program under the condition that I make clear
  324.      that this program has not been tested extensively and is to be
  325.      considered as in a pre-alpha test state.
  326.  
  327. I have decided to distribute this program anyway, because it
  328. outclasses *any* external sort program I have seen for MS-DOS: both
  329. in performance and functionality.
  330.  
  331.    * Performance:
  332.  
  333.        1. When used with a fast (preferably cached) disk, this
  334.           program is as fast as V. Buerg's `sortf' (if the latter is
  335.           used with large, non default keys, GNU `sort' is
  336.           *considerably* faster).
  337.  
  338.        2. There are (almost) no build-in hard limits!  (I have put
  339.           one hard and one soft limit in the MS-DOS version, *note
  340.           MS-DOS::.).
  341.  
  342.    * Functionality:
  343.  
  344.        1. GNU `sort' works as a filter.
  345.  
  346.        2. GNU `sort' has lots of *useful* options (*note Options::.).
  347.  
  348. This distribution is different from the other ports of GNU software
  349. for MS-DOS: it contains the full, unabridged source code and no
  350. context diffs.  This is because GNU `sort' has not yet been released
  351. by the Free Software Foundation, and therefore you can't pick up the
  352. official source from prep.  But: *all* changes (which are very few)
  353. are conditionalized with `MSDOS'.
  354.  
  355. Please send bug reports (preferably with fixes (*context* `diff''s!) to
  356.  
  357.            Thorsten Ohl
  358.            <td12@ddagsi3.bitnet>
  359.  
  360. I can make no promises to fix it immediately, but I might want to!
  361.  
  362.  
  363. 
  364. File: sort.info,  Node: Installation,  Next: Options,  Prev: Introduction,  Up: Top
  365.  
  366. How to install the MS-DOS version of GNU `sort'.
  367. ************************************************
  368.  
  369.   1. Edit the following variables in the makefile
  370.  
  371.     `LIBS'
  372.           Remove `glob.obj', `msd_dir.obj', and `_cwild.obj' if you
  373.           don't have `glob.c', `msd_dir.c', `msd_dir.h', and
  374.           `_cwild.c' from the other MS-DOS ports (e.g. fileutils), or
  375.           if you do not want a reasonable filename globbing.
  376.  
  377.     `VPATH'
  378.           Include path for `glob.c', `msd_dir.c', `msd_dir.h', and
  379.           `_cwild.c' on *your* system.  If you have a loosing (non
  380.           GNU) `make' that doesn't understand `VPATH', copy the
  381.           sources in your current directory.
  382.  
  383.     `CFLAGS, LDFLAGS'
  384.           These are for the Microsoft C compiler Version 6.0, edit
  385.           them for your system:
  386.  
  387.          `-AC'
  388.                Compact memory model
  389.  
  390.          `-W4'
  391.                Full warnings!
  392.  
  393.          `-Ocgilt'
  394.                (Almost) maximal optimization.
  395.  
  396.          `-Za'
  397.          `-DSTDC_HEADERS'
  398.                ANSI C.
  399.  
  400.          `-DUSG'
  401.                Microsoft's C looks more like System V than BSD.
  402.  
  403.          `/e'
  404.                Pack the executable.
  405.  
  406.          `/st:0x8000'
  407.                Large stack.
  408.  
  409.          `/noe'
  410.                If duplicate symbols in object files and libraries,
  411.                use the one from the object file.
  412.  
  413.   2. Say `make'.
  414.  
  415. That's all.
  416.  
  417.  
  418. 
  419. File: sort.info,  Node: Options,  Next: MS-DOS,  Prev: Installation,  Up: Top
  420.  
  421. Options for GNU `sort'
  422. **********************
  423.  
  424.      `sort' [-cmuV] [-t c] [-o `file'] [-T `dir']
  425.             [-bdfiMnr] [+n [-m] ...] [`file' ...]
  426.  
  427. The following is a guide to GNU `sort', *not* a collection of
  428. *documented options* that can be relied on.
  429.  
  430. * Menu:
  431.  
  432. * Global::        Options affecting all sort keys together.
  433. * Keys::        Specification of the sort keys.
  434. * Local::        Options for one or all sort keys.
  435.  
  436.  
  437. 
  438. File: sort.info,  Node: Global,  Next: Keys,  Up: Options
  439.  
  440. Options affecting all sort keys
  441. ===============================
  442.  
  443. `-c'
  444.      Check sort order  only.
  445.  
  446. `-m'
  447.      Merge presorted files (avoids resorting of already sorted files,
  448.      which is generally a slow operation).
  449.  
  450. `-o`file''
  451.      Send output to `file' (overwriting).
  452.  
  453. `-tc'
  454.      Use c as field separator.
  455.  
  456. `-T`prefix''
  457.      Use `prefix' as prefix for temporary files (e.g.
  458.      `prefix/sort3141.137'), default is `$TMP'.
  459.  
  460. `-u'
  461.      Delete duplicate lines from the output.
  462.  
  463. `-V'
  464.      Print the version string
  465.  
  466. *Note Local:: for more options that can affect all keys.
  467.  
  468.  
  469. 
  470. File: sort.info,  Node: Keys,  Next: Local,  Prev: Global,  Up: Options
  471.  
  472. How to specify the sort keys
  473. ============================
  474.  
  475. Keys are zero based, thus the first field has number 0, and so on.
  476.  
  477. `+num1.num2'
  478.      Start a new key at character num2 of field num1.
  479.  
  480. `-num1.num2'
  481.      Extend the key upto (not including) character num2 of field num1.
  482.  
  483.  
  484. 
  485. File: sort.info,  Node: Local,  Prev: Keys,  Up: Options
  486.  
  487. Options affecting one or all sort keys
  488. ======================================
  489.  
  490. These option apply either globally to all sort keys (if they are
  491. specified before the keys on the command line), or to a single key
  492. (if they are appended to the key specification).
  493.  
  494. `-b'
  495.      Skip white space.
  496.  
  497. `-d'
  498.      Dictionary mode: ignore punctuation.
  499.  
  500. `-f'
  501.      Fold to lowercase.
  502.  
  503. `-i'
  504.      Ignore nonprinting characters.
  505.  
  506. `-M'
  507.      Sort as english (three character) month names.
  508.  
  509. `-n'
  510.      Sort numrically.
  511.  
  512. `-r'
  513.      Sort in reverse.
  514.  
  515.  
  516. 
  517. File: sort.info,  Node: MS-DOS,  Prev: Options,  Up: Top
  518.  
  519. How the MS-DOS version differs
  520. ******************************
  521.  
  522.    * The maximum line length has been reduced to 32k.  While the
  523.      introduction of arbitrary upper limits is alien to the GNU
  524.      project, this particular limit seems to be o.k. for MS-DOS
  525.      applications and tremendously decreases the number of required
  526.      changes in the original source.
  527.  
  528.    * The maximum number of lines per input buffer is restricted to
  529.      about 4000.  This limit can only be reached by files with an
  530.      average linelength smaller that 8 characters.  To allow the
  531.      sorting of such files, the following option has been included to
  532.      reduce the input buffer size:
  533.  
  534.     `-S num'
  535.           Set the input buffer size (default 32k) to num.
  536.  
  537. 
  538. Tag Table:
  539. Node: Top1085
  540. Node: Copying1332
  541. Node: Introduction14663
  542. Node: Installation16459
  543. Node: Options17924
  544. Node: Global18412
  545. Node: Keys19047
  546. Node: Local19403
  547. Node: MS-DOS19988
  548. 
  549. End Tag Table
  550.